package com.auxgroup.smarthome.app.entity;

import com.auxgroup.smarthome.entity.AbstractGenericEntity;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * 峰谷表
 * Created by niuGuangzhe on 2017/8/1.
 */
@Entity
@Table(name = "app_peak_valley")
public class AppPeakValleyEntity extends AbstractGenericEntity {
    /**
     * 完全没有必要多这样一个主键
     * 因为需求是一个设备只有一个峰谷节电，难道是考虑未来的需求扩展？？？
     */
    @Id
    @GeneratedValue(generator = "uuid2")
    @GenericGenerator(name = "uuid2", strategy = "uuid2")
    @Column(columnDefinition=" VARCHAR(36) NOT NULL COMMENT '主键'")
    private String peakValleyId;

    @Column(columnDefinition=" VARCHAR(36) NOT NULL COMMENT '设备主键'")
    private String deviceId;


    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波峰开始小时'")
    private Integer peakStartHour;
    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波峰开始分钟'")
    private Integer peakStartMinute;
    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波峰结束小时'")
    private Integer peakEndHour;
    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波峰开始分钟'")
    private Integer peakEndMinute;

    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波谷开始小时'")
    private Integer valleyStartHour;
    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波谷开始分钟'")
    private Integer valleyStartMinute;
    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波谷结束小时'")
    private Integer valleyEndHour;
    @Column(columnDefinition = "smallint(3) NOT NULL DEFAULT 0 COMMENT '波谷结束分钟'")
    private Integer valleyEndMinute;

    @Column( name = "is_on",columnDefinition="BIT NOT NULL DEFAULT 0 COMMENT '峰谷节电是否开启 0:关闭 1：开启'")
    private Boolean on;

    @Column(columnDefinition = "VARCHAR(50) NOT NULL DEFAULT 0 COMMENT '机智云产品productKey'")
    private String pk;

    @Column(columnDefinition = "VARCHAR(50) NOT NULL DEFAULT 0 COMMENT '机智云产品did'")
    private String did;

    public String getPeakValleyId() {
        return peakValleyId;
    }

    public void setPeakValleyId(String peakValleyId) {
        this.peakValleyId = peakValleyId;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public Integer getPeakStartHour() {
        return peakStartHour;
    }

    public void setPeakStartHour(Integer peakStartHour) {
        this.peakStartHour = peakStartHour;
    }

    public Integer getPeakStartMinute() {
        return peakStartMinute;
    }

    public void setPeakStartMinute(Integer peakStartMinute) {
        this.peakStartMinute = peakStartMinute;
    }

    public Integer getPeakEndHour() {
        return peakEndHour;
    }

    public void setPeakEndHour(Integer peakEndHour) {
        this.peakEndHour = peakEndHour;
    }

    public Integer getPeakEndMinute() {
        return peakEndMinute;
    }

    public void setPeakEndMinute(Integer peakEndMinute) {
        this.peakEndMinute = peakEndMinute;
    }

    public Integer getValleyStartHour() {
        return valleyStartHour;
    }

    public void setValleyStartHour(Integer valleyStartHour) {
        this.valleyStartHour = valleyStartHour;
    }

    public Integer getValleyStartMinute() {
        return valleyStartMinute;
    }

    public void setValleyStartMinute(Integer valleyStartMinute) {
        this.valleyStartMinute = valleyStartMinute;
    }

    public Integer getValleyEndHour() {
        return valleyEndHour;
    }

    public void setValleyEndHour(Integer valleyEndHour) {
        this.valleyEndHour = valleyEndHour;
    }

    public Integer getValleyEndMinute() {
        return valleyEndMinute;
    }

    public void setValleyEndMinute(Integer valleyEndMinute) {
        this.valleyEndMinute = valleyEndMinute;
    }

    public Boolean getOn() {
        return on;
    }

    public void setOn(Boolean on) {
        this.on = on;
    }

    public String getPk() {
        return pk;
    }

    public void setPk(String pk) {
        this.pk = pk;
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did;
    }

    public AppPeakValleyEntity() {
    }

    public AppPeakValleyEntity(String deviceId, String pk, String did) {
        this.deviceId = deviceId;
        this.pk = pk;
        this.did = did;
    }
}
